<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //序列化  把对象转换成json格式字符串
        const obj1={
            name:'zhangsan',
            age:19
        }
        JSON.stringify(obj1);

        //反序列化 把json字符串,转换为json数据
        const obj2={"name":"张三","age":19}
        JSON.parse(obj2);
    </script>
</body>
</html>